﻿function selChange(container, type, state){
    var dom = document.getElementById(container);
    var items = dom.getElementsByTagName(type);
    for(i = 0;i<items.length;i++){
        items[i].checked = state;
    }
    setDelState();
}
//设置删除状态
function setDelState()
{
    var readflag=false;
    var elments = $("div_outbox").getElementsByTagName("input");
    for (var i = 0; i < elments.length; i++)
    {
        if(elments[i].type=="checkbox" && elments[i].checked)
        {
            readflag=true;
            break;           
        }        
    }
    if(readflag)
    {
        $("showDELDiv").style.display="";
        $("hideDelDiv").style.display="none";
    }
    else
    {
        $("showDELDiv").style.display="none";
        $("hideDelDiv").style.display="";
    }
}
function del(pmid)
{
   
    $("Rety").value=pmid;
    $("Form1").action = "/Mail/Outbox.htm";
    $("Form1").submit();
}
function Adel(id)
{    
        var va="";
        var dom = document.getElementById('div_outbox');
        var items = dom.getElementsByTagName('input');
        for(i = 0;i<items.length;i++){
            if(items[i].checked)
            {
                    va+= items[i].value+',';
            }
        }
        if(va==""&&id=="-1"){return;}
     showProgressBar(false,true);
    $("$divIput$").style.display = "none";
    var title = C1008;
    var body="";
    if(id!="-1")
    {
    body="<div class='Popup_button'><input type='button' value='"+C0069+"' id='addOkButton' class='button' onclick=\"del('"+id+"')\" />&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='"+gCancel+"' id='addCancelButton' class='buttong' onclick='webFailure()'/></div>";
    }else
    {
        
       body="<div class='Popup_button'><input type='button' value='"+C0069+"' id='addOkButton' class='button' onclick=\"Cdel('"+va+"')\" />&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='"+gCancel+"' id='addCancelButton' class='buttong' onclick='webFailure()'/></div>"; 
    }
    var obj = {}
    $ShowMessageBox$(title,body,obj,webFailure,300); 
}
function webFailure()
{
    $EndMessageBox$();
}
function Cdel(va)
{
    
  var vale=va.substring(0,va.length-1); 
   $("Rety").value="0";
   $("DPID").value =vale;   
    $("Form1").action = "/Mail/Outbox.htm";
    $("Form1").submit();
}
